![]() |
WindowTitleDrawingProcPtr |
||||
Header: | Appearance.h | Carbon status: | Supported | |
Draws a window title.
typedef void(* WindowTitleDrawingProcPtr) ( const Rect *bounds, SInt16 depth, Boolean colorDevice, UInt32 userData );
You would declare your function like this if you were to name it MyWindowTitleDrawingCallback:
void MyWindowTitleDrawingCallback ( const Rect *bounds, SInt16 depth, Boolean colorDevice, UInt32 userData );
A pointer to a structure of type Rect. The rectangle you are passed is set to the area in which you should draw your window title content. Your window title drawing function is called clipped to the rectangle in which you are allowed to draw your content; do not draw outside this region.
A signed 16-bit value. You are passed the bit depth (in bits per pixel) of the current graphics port.
A value of type Boolean. If true, indicates that you are drawing on a color device; a value of false indicates a monochrome device.
A signed 32-bit value. You are passed data specifying how to draw the window title content, from the titleData parameter of DrawThemeWindowFrame.
At the time your window title drawing function is called, the foreground text color and mode is already set to draw in the correct window state (active or inactive) and correct color for the theme. You do not need to set the color unless you have special drawing needs. If you do have special drawing needs, you should supply the depth value and the value of the colorDevice parameter to the function IsThemeInColor to determine whether or not you should draw the window title content in color. Note that the Appearance Manager calls your MyWindowTitleDrawingCallback function for every device that the bounds rectangle intersects.
You shoudl refer to your MyWindowTitleDrawingCallback function using a WindowTitleDrawingUPP, which you can create with the NewWindowTitleDrawingProc macro.
You typically use the NewWindowTitleDrawingProc macro like this:
WindowTitleDrawingUPP myWindowTitleDrawingUPP;
myWindowTitleDrawingUPP = NewWindowTitleDrawingProc(MyWindowTitleDrawingCallback);
You typically use the CallWindowTitleDrawingProc macro like this:
CallWindowTitleDrawingProc(myWindowTitleDrawingUPP, bounds, depth, colorDevice, userData);
The Appearance Manager draws the background of the window title prior to calling your window title drawing function, so you should not erase the background from this function.
This function is available with Appearance Manager 1.1 and later.
Supported in Carbon.
© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)